﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Cms/Admin.Master" AutoEventWireup="true"
    CodeBehind="Main.aspx.cs" Inherits="Aij1.Cms.Main" %>

<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dx1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1 { width: 100%; }
    </style>
    <script type="text/javascript">
        function setCookieExpire(name, value, days) {
            var exp = new Date();
            exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000);
            document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
        }

        function cbxTheme_SelectedIndexChanged(s, e) {
            setCookieExpire("Aij1_Theme", s.GetText(), 30);
            top.location.reload();
        }
    </script>
</asp:Content>
<asp:Content ID="CT2" ContentPlaceHolderID="PH" runat="server">
    <p>
        &nbsp;</p>
    <div style="width: 80%; margin: auto">
        <table class="style1">
            <tr>
                <td width="85">
                    &nbsp;
                </td>
                <td width="50%">
                    管理首页
                </td>
                <td width="80">
                    &nbsp;
                </td>
                <td>
                    在此日期之后:
                </td>
            </tr>
            <tr>
                <td width="85">
                    页面风格:
                </td>
                <td width="50%">
                    <dx:ASPxComboBox ID="cbxTheme" runat="server">
                        <ClientSideEvents SelectedIndexChanged="cbxTheme_SelectedIndexChanged" />
                    </dx:ASPxComboBox>
                </td>
                <td width="80">
                    查询日期:
                </td>
                <td>
                    <dx:ASPxDateEdit ID="dtQueryDate" runat="server" AutoPostBack="True">
                    </dx:ASPxDateEdit>
                </td>
            </tr>
            <tr>
                <td>
                    文章数:
                </td>
                <td>
                    <%=GetDBArticleCount(true) %>
                </td>
                <td>
                    文章数:
                </td>
                <td>
                  <a href="NewsMan.aspx"><%=GetDBArticleCount(false) %></a>
                </td>
            </tr>
            <tr>
                <td>
                    评论数:
                </td>
                <td>
                    <%=GetCommentCount(true) %>
                </td>
                <td>
                    评论数:
                </td>
                <td>
                 <a href="CommentMan.aspx"><%=GetCommentCount(false) %></a>
                </td>
            </tr>
            <tr>
                <td>
                    留言数:
                </td>
                <td>
                    <%= GetNoteCount(true) %>
                </td>
                <td>
                    留言数:
                </td>
                <td>
                  <a href="ReplyGuest.aspx"><%=GetNoteCount(false)%></a>
                </td>
            </tr>
            <tr>
                <td>
                    图片数:
                </td>
                <td>
                    <%=GetDBImgCount(true) %>
                </td>
                <td>
                    图片数:
                </td>
                <td>
                    <a href="AlbumMan.aspx"><%=GetDBImgCount(false) %></a>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    客户数:</td>
                <td>
                    <%= GetCustomerCount(true) %></td>
                <td>
                    客户数:</td>
                <td>
                 <a href="CustomerMan.aspx"><%=GetCustomerCount(false)%></a></td>
            </tr>
            <tr>
                <td>
                    订单数:</td>
                <td>
                    <%=GetOrderCount(true) %></td>
                <td>
                    订单数:</td>
                <td>
                 <a href="OrderMan.aspx"><%=GetOrderCount(false) %></a></td>
            </tr>
        </table>
        <p>
            &nbsp;</p>
        <table class="style1">
            <tr>
                <td width="90">
                    &nbsp;
                </td>
                <td width="200">
                    &nbsp;
                </td>
                <td width="120">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td width="90">
                    数据库占用空间:
                </td>
                <td width="200">
                    <dx:ASPxProgressBar ID="pgDBSize" runat="server" Height="21px" Position="50" Width="200px"
                        DisplayFormatString="0M" DisplayMode="Position">
                    </dx:ASPxProgressBar>
                </td>
                <td width="130">
                    <dx:ASPxButton ID="btnPurgeData" runat="server" Text="清除已删除记录" Width="120px" OnClick="btnPurgeData_Click">
                    </dx:ASPxButton>
                </td>
                <td width="110">
                    <dx:ASPxButton ID="btnShrinkDB" runat="server" Text="压缩日志" OnClick="btnShrinkDB_Click">
                    </dx:ASPxButton>
                </td>
                <td>
                    压缩数据库日志以节约空间
                </td>
            </tr>
            <tr>
                <td>
                    网站占用空间:
                </td>
                <td>
                    <dx:ASPxProgressBar ID="pgSiteSize" runat="server" Height="21px" Position="0" Width="200px"
                        DisplayFormatString="0M" DisplayMode="Position" Maximum="1000">
                    </dx:ASPxProgressBar>
                </td>
                <td>
                    图片占用:<%=GetDiskImgSize().ToString("0M") %>
                </td>
                <td>
                    <dx:ASPxButton ID="btnReCalc" runat="server" Text="重新计算" OnClick="btnReCalc_Click">
                    </dx:ASPxButton>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    数据库图片数:
                </td>
                <td>
                    <%=GetDBImgCount(true) %>
                </td>
                <td>
                    本地图片数:<%=GetDiskImgCount() %>
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    操作提示:
                </td>
                <td colspan="2">
                    <dx:ASPxLabel ID="lblTips" runat="server" CssClass="tips" ClientInstanceName="lblTips">
                    </dx:ASPxLabel>
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
